package
{
	import flash.system.Capabilities;
	
	/**
	 * ...
	 * @author SChabanov
	 */
	public class Logger 
	{
		
		private static var _systemInfo:Boolean = false;
		
		private static function logSysInfo():void
		{
			if (_systemInfo) return;
			Debug.clear();
			var output:String = "-------------------------------System Info-----------------------------------\n";
			output += 'OS: ' + Capabilities.os + "\n";
			output += 'CPU: ' + Capabilities.cpuArchitecture + '\n';
			output += 'ScreenDPI: ' + Capabilities.screenDPI + '\n';
			output += 'Resolution: ' + Capabilities.screenResolutionX +"x" + Capabilities.screenResolutionY + "\n";
			output += 'PlayerType: ' + Capabilities.playerType + "\n";
			output += 'Version: ' + Capabilities.version +"\n";
			output += 'Debug: ' + Capabilities.isDebugger + '\n';
			output += 'isRunFromPDF: ' + Capabilities.isEmbeddedInAcrobat + '\n';
		
			output += "--------------------------------------------------------------------------"
			Debug.log(output,Debug.GREEN);
			_systemInfo = true;
		}
		
		public static function clear():void
		{
			Debug.clear();
		}
		
		public  static function globalLog(message:String,error:Boolean=false):void
		{
			logSysInfo();
			error ? Debug.log(message,Debug.RED) : Debug.log(message);
		}
		
		public static function aloowLog(value:Boolean):void
		{
			Debug.allowLog = value;
		}
		
	}

}